package com.bJian.bJIanOJ.controller;

import com.bJian.bJIanOJ.common.BaseResponse;
import com.bJian.bJIanOJ.common.ErrorCode;
import com.bJian.bJIanOJ.common.ResultUtils;
import com.bJian.bJIanOJ.exception.BusinessException;
import com.bJian.bJIanOJ.model.dto.postthumb.PostThumbAddRequest;
import com.bJian.bJIanOJ.model.dto.question_submit.QuestionSubmitAddRequest;
import com.bJian.bJIanOJ.model.entity.User;
import com.bJian.bJIanOJ.service.UserService;
import com.bJian.bJIanOJ.service.question_submitService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 题目提交接口
 *
 * @author bJian
 * @from  
 */
//@RestController
//@RequestMapping("/question_submit")
@Slf4j
public class QuestionSubmitController {

    @Resource
    private question_submitService questionSubmitService;

    @Resource
    private UserService userService;

    /**
     * 题目提交
     *
     * @param question_submitAddRequest 题目提交参数
     * @param request
     */
//    @PostMapping("/")
//    public BaseResponse<Long> doSubmit(@RequestBody QuestionSubmitAddRequest question_submitAddRequest,
//                                         HttpServletRequest request) {
//        if (question_submitAddRequest == null || question_submitAddRequest.getQuestionId() <= 0) {
//            throw new BusinessException(ErrorCode.PARAMS_ERROR);
//        }
//        // 登录才能提交
//        final User loginUser = userService.getLoginUser(request);
//        long QuestionId = question_submitAddRequest.getQuestionId();
//        Long result = questionSubmitService.doSubmit(question_submitAddRequest);
//        return ResultUtils.success(result);
//    }

}
